﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:AppsListControl="clr-namespace:Coding4Fun.AppsListControl">

    <Style TargetType="AppsListControl:RatingControl">
        <Setter Property="UseIndicators" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="AppsListControl:RatingControl">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ContentControl HorizontalAlignment="Left" Content="{TemplateBinding Content}">
                        </ContentControl>
                        <TextBlock HorizontalAlignment="Left" FontSize="10" x:Name="Indicators" Text="%Total% ratings" Grid.Row="1"/>
                    </Grid>
                </ControlTemplate>

            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="AppsListControl:RatingButton">
        <Setter Property="IsEnabled" Value="true" />
        <Setter Property="IsChecked" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="AppsListControl:RatingButton">
                    <Grid Opacity="0.5" x:Name="grid">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused"/>
                                <vsm:VisualState x:Name="Unfocused"/>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathMouseOver" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value=".5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathMouseOver" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathMouseOver" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed"/>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="CheckStates">
                                <vsm:VisualState x:Name="Indeterminate">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathMouseOver" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathUnchecked" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathChecked" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathIndeterminate" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathMouseOver" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathUnchecked" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathChecked" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathIndeterminate" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathMouseOver" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathUnchecked" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathChecked" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="pathIndeterminate" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Grid Width="24" Height="23" x:Name="pathUnchecked" Opacity="0">
                            <Path Width="24" Height="23" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFFFFFFF" Data="F1 M 24,10.2671L 15.26,10.2048L 12.5,1.91182L 9.74,10.2048L 1,10.2671L 8.03423,15.4546L 5.39261,23.7861L 12.5,18.6992L 19.6074,23.7861L 16.9658,15.4546L 24,10.2671 Z "/>
                        </Grid>
                        <Grid Width="24" Height="23" x:Name="pathChecked" Opacity="0">
                            <Path Width="24" Height="23" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="Blue"  Data="F1 M 24,10.2671L 15.26,10.2048L 12.5,1.91182L 9.74,10.2048L 1,10.2671L 8.03423,15.4546L 5.39261,23.7861L 12.5,18.6992L 19.6074,23.7861L 16.9658,15.4546L 24,10.2671 Z "/>
                        </Grid>
                        <Grid Width="24" Height="23" x:Name="pathIndeterminate" Opacity="0">
                            <Path Width="24" Height="23" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FF230FD2" Data="M 12.6963,1.56285L 15.4563,9.85585L 24.1963,9.91809L 17.1621,15.1057L 19.8037,23.4371L 12.6963,18.3503M 1.19631,9.91809L 9.93631,9.85585L 12.6963,1.56285L 15.4563,9.85585L 24.1963,9.91809L 17.1621,15.1057L 19.8037,23.4371L 12.6963,18.3503L 5.58892,23.4371L 8.23053,15.1057L 1.19631,9.91809 Z "/>
                        </Grid>
                        <Grid Width="24" Height="23" x:Name="pathMouseOver" Opacity="0">
                           <Path Width="24" Height="23" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="Red" Data="F1 M 24,10.2671L 15.26,10.2048L 12.5,1.91182L 9.74,10.2048L 1,10.2671L 8.03423,15.4546L 5.39261,23.7861L 12.5,18.6992L 19.6074,23.7861L 16.9658,15.4546L 24,10.2671 Z "/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
                
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>